﻿namespace LxCore
{
    public partial class PhysicalModel
    {
        private bool isInCheckModelSet;
        protected void CheckModelSet()
        {
            if (isInCheckModelSet)
            {
                return;
            }
            isInCheckModelSet = true;
            //FlowType
            switch (PhysicalType)
            {
                case PhysicalTypes.固体: FlowType = null; break;
                case PhysicalTypes.流体: if (FlowType is null) FlowType = FlowTypes.层流; break;
            }
            //TurbulenceType
            switch (FlowType)
            {
                default: TurbulenceType = null; break;
                case FlowTypes.湍流: if (TurbulenceType is null) TurbulenceType = TurbulenceTypes.k_Omega; break;
            }
            //TurbBoundType
            switch (TurbulenceType)
            {
                default: TurbBoundType = null; break;
                case TurbulenceTypes.k_Omega: if (TurbBoundType is null) TurbBoundType = TurbBoundTypes.AllYPlus; break;
            }
            //BuoyancyType
            switch (PhysicalType, IsEnergyEnabled)
            {
                default: BuoyancyType = null; break;
                case (PhysicalTypes.流体, true): if (BuoyancyType is null) BuoyancyType = BuoyancyTypes.无; break;
            }
            isInCheckModelSet = false;
        }
    }
}
